package cn.credit.loan.service.creditresult;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.credit.loan.dao.creditresult.CreditresultMapper;
import cn.credit.loan.entity.Creditresult;
@Service
@Transactional
public class CreditresultServiceImpl implements CreditresultService {
		@Autowired
		public CreditresultMapper creditresultMapper;
		
		/**
		 * 授信额度评分
		 */
	@Override
	public List<Creditresult> getCreditresutList(Creditresult creditresult) throws Exception {
		List<Creditresult> creditresultlist=creditresultMapper.getCreditresutList(creditresult);
		if(creditresultlist!=null)
		{
			return creditresultlist;
		}
		return null;
	}
	/**
	 * 授信额度添加
	 */
		@Override
		public boolean getCreditresultAdd(Creditresult creditresult) throws Exception {
			if(creditresult!=null){
			int num=creditresultMapper.getCreditresultAdd(creditresult);
			if(num>0)
			{
				return true;
			}
			}
			return false;
		}
		/**
		 * 授信额度更新
		 */
	@Override
	public boolean getCreditresultUpdate(Creditresult creditresult) throws Exception {
		if(creditresult!=null){
			int num=creditresultMapper.getCreditresultUpdate(creditresult);
			if(num>0)
			{
				return true;
			}
			}
			return false;
	}
	/**
	 * 授信额度删除
	 */
		@Override
		public boolean getCreditresultDelete(int creditId) throws Exception {
				return creditresultMapper.getCreditresultDelete(creditId);
		}

}
